home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / nkcc / nkcc.doc < prev    next >
Encoding:
Text File  |  1994-09-22  |  28.2 KB  |  649 lines

  1.  
  2.    NKCC - NORMALIZED KEY CODE CONVERTER
  3.    =============================================================================
  4.    Release 2.91
  5.  
  6.    Written by Harald Siegmund                            Copyright (c) 1989-1994
  7.  
  8.    NKCC is Public Domain and may be used by anyone. Don't change or delete any
  9.    files of the NKCC folder. Please put a small note in your application's
  10.    info box if it contains NKCC (for example "Keyboard handler by Harald
  11.    Siegmund"). Thanx!
  12.    -----------------------------------------------------------------------------
  13.    Documentation and program history:
  14.  
  15.    1989:
  16.       May 14:    introducing NKCC (release 1.00)
  17.       Jun/Jul:   improvements, changes, debugging
  18.  
  19.    1990:
  20.       Jan 13:    further improvements
  21.       May 27-28: creation of file
  22.                  (complete new documentation for NKCC 2.x)
  23.       Jun 16-27: multi event assembler entry added by Gerd Knops
  24.       Jun 30:    release 1.10: return shift state flags (returned by
  25.                  nkc_multi()) compatible to NKF_... flags
  26.       Jul 09:    release 1.20: new function: nkc_kstate()
  27.       Aug 03:    release 1.30: new function: nkc_cmp()
  28.       Aug 18:    bug fixed in nkc_kstate()
  29.       Sep 15-16: release 1.40: mouse button event handler; nkc_timer()
  30.       Oct 03:    renaming NKCC II release 1.40 to NKCC release 2.40
  31.                  function overview
  32.       Oct 30:    removing chapter 6 (notes for users of NKCC 1.xx)
  33.       Nov 13:    release 2.41: NK_LEFT and NK_RIGHT exchanged
  34.       Dec 11:    release 2.50: MU_XTIMER
  35.  
  36.    1991:
  37.       Jan 11:    release 2.51: better handling of MU_XTIMER
  38.       Apr 14:    release 2.60: nkc_conv() renamed to nkc_tconv();
  39.                  new function nkc_gconv()
  40.                  rearranging and partly rewriting documentation
  41.       May 10:    release 2.61 (debugging)
  42.       May 29:    release 2.62: nkc_toupper, nkc_tolower
  43.       Jun 08:    doing some small corrections of the documentation
  44.       Aug 06:    release 2.63: quote (") is now used as synonym for
  45.                  umlaut (¨) in deadkey handling
  46.       Aug 07:    more deadkeys...
  47.       Aug 22:    release 2.70:
  48.                  deadkeys can now be enabled/disabled separately
  49.                  additional note in 3.b)
  50.                  nkc_init() now returns version #
  51.       Sep 07:    release 2.71:
  52.                  nkc_cmp() improved
  53.                  NKF_RESVD is now used:
  54.                   in key codes for internal purposes!
  55.                   in reference key code (nkc_cmp()) as flag
  56.       Nov 05:    release 2.72:
  57.                  adjustments to ASCII input feature of TOS 3.06
  58.       Nov 16:    release 2.80:
  59.                  small bug fixed in nkc_cmp()
  60.                  control key emulation (NKS_CTRL) (see chapter 1)
  61.       Dec 29:    minor changes in source documentation;
  62.                  a few new (less important) symbols were added
  63.  
  64.    1992:
  65.       Jan 03/06: introducing release 2.81:
  66.                  - nkc_init's first parameter is now an unsigned long
  67.                  - the symbolic identifiers BE_ON/OFF/TOS are redefined,
  68.                    but still have the same meaning
  69.                  - new symbols: NKI_...
  70.                  - chapters 4, 7 and 9 were adjusted respectively
  71.                    completed due to the changes in nkc_init()
  72.                  - chapters 8 and 9 got additional notes about nkc_timer()
  73.       Feb 14:    correcting documentation of nkc_exit() in chapter 4
  74.       Feb 28:    NKCOWNPB switch
  75.  
  76.    1993:
  77.       Dec 11:    release 2.90:
  78.                  - NKCC_GPB.O and SDOCSYNT.S are no longer part of the package
  79.                  - Selecting the version of NKCC for assembling (GEM or TOS) is
  80.                     done by a different symbol now: NKCGEM
  81.                  - NKCC uses its own AES/VDI parameter arrays now, execpt
  82.                    for the global array, which is passed as additional
  83.                    parameter to function nkc_init()
  84.                  - nkc_toupper and nkc_tolower are functions now rather than
  85.                    arrays
  86.                  - cosmetic changes in the documentation
  87.                  - new developer address
  88.       Dec 12:    introducing new functions nkc_n2tos() and nkc_n2gem()
  89.                  (which convert key codes in normalized format back to the
  90.                   system's format; see NKCC.TXT for details)
  91.  
  92.    1994:
  93.       Feb 01:    adding MausNet address to documentation
  94.       May 19:    release 2.91:
  95.                  - nkc_exit won't touch the system variable contern any longer
  96.                    because it may have been changed by a parallel running
  97.                    process
  98.                  - two new deadkeys were introduced:
  99.                    / + 2 = ½
  100.                    / + 4 = ¼
  101.                  - the synatx of MadMac's directives has been added to the NKCC
  102.                    source file (and NKCC.TXT)
  103.  
  104.    -----------------------------------------------------------------------------
  105.    Developer contact:
  106.  
  107.    as adequate systems
  108.    Gesellschaft für angemessene Systemlösungen mbH
  109.    c/o Harald Siegmund
  110.    Am Steinern Kreuz 19
  111.    D-64297 Darmstadt
  112.    Germany
  113.  
  114.    e-mail address: Harald_Siegmund@kl.maus.de
  115.  
  116.    =============================================================================
  117.    Table of contents
  118.  
  119.    1. What is NKCC?
  120.    2. Files on the disk
  121.    3. The normalized key code format
  122.    4. NKCC usage
  123.    5. NKCC in TOS applications
  124.    6. NKCC in GEM applications
  125.    7. The button event handler
  126.    8. Other fine extra features
  127.    9. Symbol overview
  128.  
  129.  
  130.  
  131.  
  132.    1. What is NKCC?
  133.    =============================================================================
  134.    Did you ever try to program a complex keyboard handling? Then you sure know
  135.    some of the problems coming out of TOS along with the key codes ...
  136.  
  137.    a) pressing Alternate + any letter will only return the scan code, which is
  138.       TOS version-dependend (language)
  139.  
  140.    b) some keys get different scan codes when being pressed together with
  141.       Alternate! For example, hitting the '1' key will return a scan code
  142.       of 2 (on the German TOS) and an ASCII code of $31 (that's ok). The key
  143.       combination Alternate + '1' results in a scan code of $78 and an ASCII
  144.       code of 0!
  145.  
  146.    c) the cursor keypad (arrows, Insert, ClrHome, Help and Undo) is a whole
  147.       chaos! Some of the keys change their scan code when being pressed
  148.       together with Control. The returned ASCII code is total rubbish and
  149.       follows no rule.
  150.  
  151.    d) some different key combinations return the same key codes. In most cases,
  152.       Alternate+any key and Alternate+Shift+any key cannot be distinguished.
  153.  
  154.    The solution: the Normalized Key Code Converter
  155.  
  156.    NKCC solves all of this problems. It converts key codes received from GEMDOS
  157.    or GEM (multi event) to an own, sophisticated format, which allows to detect
  158.    all possible key combinations. In addition, NKCC offers some special
  159.    features:
  160.  
  161.    a) Deadkey handling
  162.  
  163.       People in countries which know characters with accents often have the
  164.       problem that they can't reach every character directly from the keyboard.
  165.       Or imagine a guy who wants to type a French text on a UK TOS - without
  166.       having characters like Ç or ë! This can be done if NKCC was built in his
  167.       favourite word processor. It transforms combinations of key strokes to
  168.       one character. The first one is called the deadkey: when you type it,
  169.       nothing happens - yet. After the second key stroke, NKCC decides what to
  170.       do. If matching with the first one, it merges both to one key code (for
  171.       example: ~  plus  A  will result in  Ã). If not matching, the program
  172.       will get both keys (e.g. ~  plus  X  will directly be passed through the
  173.       deadkey manager). Deadkeys known by NKCC are
  174.  
  175.       ^   +   aeiou      =  âêîôû
  176.       ~   +   nNaoAo     =  ñÑãõÃÕ
  177.       '   +   eEaiou     =  éÉáíóú
  178.       `   +   aeiouA     =  àèìòùÀ
  179.       ¨   +   aeiouyAOU  =  äëïöüÿÄÖÜ
  180.       "   +   aeiouyAOU  =  äëïöüÿÄÖÜ
  181.       °   +   aA         =  åÅ
  182.       ,   +   cC         =  çÇ
  183.       /   +   oO24       =  øØ½¼
  184.  
  185.       The quote character as synonym for umlaut is e.g. needed on the Dutch
  186.       keyboard, where neither umlaut characters nor the umlaut itself are
  187.       available.
  188.  
  189.    b) Direct input of ASCII codes
  190.  
  191.       NKCC allows the ASCII code of characters to be input directly. Just press
  192.       the Alternate key and hold it. Then type in the ASCII code on the numeric
  193.       keyboard (as decimal number). The input is finished when either the
  194.       Alternate key is relased or three digits are typed in. Values beyond 255
  195.       are truncated to 8 bit (e.g. 260 ($104) becomes 4).
  196.  
  197.    c) Control key emulation
  198.  
  199.       Usually, NKCC returns key combinations like "Control A" as ASCII code $41
  200.       (for "A") and with a set Control key flag. If the control key emulation
  201.       is enabled, "Control A" will return an ASCII code of $01. The Control key
  202.       flag will be cleared in this case.
  203.  
  204.       The Control key emulation converts ...
  205.  
  206.       Control + @       to    $00
  207.       Control + A...Z   to    $01...$1A
  208.       Control + [       to    $1B
  209.       Control + \       to    $1C
  210.       Control + ]       to    $1D
  211.       Control + ^       to    $1E
  212.       Control + _       to    $1F
  213.  
  214.       Important note:
  215.  
  216.       On several keyboards, some of the key combinations in the list above
  217.       cannot be recognized and thus not converted. For example, on the German
  218.       keyboard, the characters "@", "[", "\" and "]" can't be typed in together
  219.       with the Control key. Their ASCII codes don't appear in any of the TOS
  220.       key code tables, because they can only be reached when holding the
  221.       Alternate key. Unfortunately, TOS returns the wrong ASCII code when
  222.       Control is also held down, making it impossible to find out the original
  223.       ASCII value.
  224.  
  225.  
  226.    Every deadkey and special feature can be enabled/disabled separately.
  227.  
  228.    The best way to see how NKCC works is to start the test utility (TEST.TOS)
  229.    and hack on the keyboard.
  230.  
  231.  
  232.  
  233.    2. Files on the disk
  234.    =============================================================================
  235.    The NKCC folder/disk/archive/whatever should contain the following files:
  236.  
  237.    NKCC.S         source of NKCC
  238.    NKCC.SH        assembler header file with NKCC definitions
  239.    NKCC.H         C header file with NKCC definitions
  240.    NKCC.O         NKCC as object file (DRI format)
  241.    NKCC_TOS.O     NKCC as object file without GEM part (DRI format)
  242.    NKCC.TXT       excerpt of NKCC.S with all global definitions
  243.    NKCC.DOC       this documentation!
  244.    TEST.C         source of small test utility
  245.    TEST.TOS       test utility as executable program
  246.    WHATSNEW.TXT   information about all new features since the last release
  247.  
  248.  
  249.  
  250.  
  251.    3. The normalized key code format
  252.    =============================================================================
  253.    NKCC returns key codes as 16 bit integer. The low byte contains the ASCII
  254.    part of the key, the high byte is the location for some flags. Here's the
  255.    complete format:
  256.  
  257.    Bit #       Symbolic name        Contents
  258.    ------------------------------------------------------------
  259.     0... 7                          ASCII code/key code
  260.     8          NKF_LSH              left Shift key flag
  261.     9          NKF_RSH              right Shift key flag
  262.    10          NKF_CTRL             Control key flag
  263.    11          NKF_ALT              Alternate key flag
  264.    12          NKF_CAPS             current state of CapsLock key
  265.    13          NKF_NUM              numeric keypad flag
  266.    14          NKF_RESVD            reserved(!) for internal purposes
  267.    15          NKF_FUNC             function flag
  268.  
  269.    Bits 8...11 speak for themself. Bit 12 reflects the current state of the
  270.    CapsLock key. Bit 13, if set, indicates that the key is located on the
  271.    numeric keypad. Bit 14 is reserved for internal use and must be ignored.
  272.    However, it has a special meaning as parameter for the function nkc_cmp(),
  273.    described in the next chapter. Finally, the MSB of the key code (bit 15)
  274.    specifies the key type: if set, the key code stands for any function to
  275.    perform. If not set, it contains any printable character. The bit is set
  276.    when
  277.  
  278.    a) any of the following "function keys" is pressed:
  279.  
  280.       Esc, Tab, Backspace, Delete, Return,
  281.       Help, Undo, Insert, ClrHome, cursor up, cursor down, cursor left,
  282.       cursor right,
  283.       Enter,
  284.       F1, F2, F3, F4, F5, F6, F7, F8, F9, F10
  285.  
  286.       The ASCII code for such keys is less than 32 and defined as NK_... in
  287.       the header files (e.g. NK_ESC for Escape).
  288.  
  289.    b) any key is pressed together with Alternate and/or Control
  290.  
  291.       In this case, NKCC always returns the CapsLock variant of a key (e.g.
  292.       the ASCII part of the key combination Control + A is 'A' rather than
  293.       'a').
  294.  
  295.  
  296.    The function flag was intentionally placed in bit 15 to ease its handling:
  297.  
  298.    if (keycode < 0)
  299.       perform function
  300.    else
  301.       use printable character
  302.  
  303.    The ASCII code of a printable character spans over the whole number range
  304.    of an unsigned byte: from 0 up to 255.
  305.  
  306.  
  307.    Please note that some key combinations cannot be caught by NKCC:
  308.  
  309.    a) keys which are hold back by TOS: any key of the cursor pad plus Alternate
  310.       (except Alternate + Undo); they are used for mouse controlling and to
  311.       start a screen hardcopy.
  312.  
  313.    b) characters which can only be typed in when pressing Alternate, such as
  314.       @\[{]} on the German keyboard. They are treated correctly by NKCC, but
  315.       they never appear with a set Alternate flag.
  316.  
  317.  
  318.    Characters created by the deadkey handler or the direct ASCII input are
  319.    returned as if present on the keyboard. None of the flags, except CapsLock,
  320.    can be set. Key codes created by the Control key emulation never appear with
  321.    a set Control key flag.
  322.  
  323.  
  324.  
  325.  
  326.    4. NKCC usage
  327.    =============================================================================
  328.    Working with NKCC is rather simple. Only a few functions have to be called.
  329.  
  330.    Before receiving the first key code, NKCC has to be initialized by an
  331.    nkc_init() call. nkc_init() gets three parameters: The first is a 32 bit
  332.    integer with some flags, defined as NKI_... in the header file NKCC.H
  333.    (respectively NKIb_.../NKIf_... in NKCC.SH). The following flags exist:
  334.  
  335.    NKI_BUTHND        are both used to control the built-in handler for mouse
  336.    NKI_BHTOS         button events, described in the chapter "The button event
  337.                      handler"
  338.  
  339.    NKI_NO200HZ       if set, NKCC won't install the timer interrupt used for
  340.                      the function nkc_timer(). Note: if the button event
  341.                      handler is being activated, this flag is ignored because
  342.                      the timer is needed then for NKCC-internal purposes.
  343.  
  344.    nkc_init()'s second parameter is the handle of a virtual VDI workstation,
  345.    also needed for the button event handler. It may be zero if the handler is
  346.    not installed.
  347.  
  348.    At last the third parameter is a pointer to the applications GLOBAL array
  349.    (one of the AES parameter arrays). The pointer isn't used by NKCC_TOS.O.
  350.    When using NKCC in applications developed with Turbo C respectively Pure C
  351.    this parameter is  _GemParBlk.global  (defined in AES.H).
  352.  
  353.    The function returns a 16 bit integer with NKCC's version number as
  354.    4 digit BCD (main # in high byte, sub # in low byte).
  355.  
  356.    The most simple call of nkc_init() would be:
  357.  
  358.    nkc_init(0,0,NULL);
  359.  
  360.  
  361.    Accordingly, NKCC has to be turned off before your program is quit. This is
  362.    done by an nkc_exit() call. The function has no input parameters, but
  363.    returns a status code: if NKCC has linked itself into the system vectors,
  364.    and somebody has corrupted the XBRA vector list, it will be unable to
  365.    deinstall and returns an according error code. This is fatal! Your program
  366.    must not terminate in this case! Show a warning message and tell the user
  367.    to reboot.
  368.  
  369.  
  370.    NKCC offers several methods to receive key codes. Their main difference is
  371.    the kind of program NKCC is linked to: TOS or GEM application/accessory.
  372.    Consult the according chapters for details.
  373.  
  374.  
  375.    The special handlers for direct ASCII input, deadkey handling etc. are
  376.    controled via the function nkc_set(). The function gets a long integer with
  377.    32 flags as parameter. A set flag enables the feature, a cleared flag
  378.    disables it. Their symbolic names are:
  379.  
  380.    NKS_ALTNUM        for direct ASCII input
  381.    NKS_CTRL          for control key emulation
  382.    NKS_D_...         for deadkey management
  383.  
  384.  
  385.    When comparing two normalized key codes, no direct check should be made
  386.    (like: if (key1 == key2) ...)! Use the function nkc_cmp() instead. It uses
  387.    some specific rules which improve the flexibility of key code comparism.
  388.    The function gets two key key codes as parameters, one called "reference
  389.    key code" and the other "test key code". Some bits of the reference key code
  390.    (the first parameter) are treated a special way:
  391.  
  392.    NKF_IGNUM (same as NKF_RESVD)
  393.       if set, the numeric keypad flag doesn't matter
  394.  
  395.    NKF_CAPS (CapsLock state)
  396.       if set, the case of the ASCII code doesn't matter
  397.  
  398.    NKF_SHIFT (both Shift keys; identical to NKF_LSH | NKF_RSH)
  399.       if BOTH shift flags are set in the reference key code, the combination of
  400.       shift key flags in the test key code doesn't matter: only one shift flag
  401.       has to be set, no matter which one.
  402.  
  403.  
  404.  
  405.  
  406.    5. NKCC in TOS applications
  407.    =============================================================================
  408.    When being used in a TOS type program (without windows, AES dialogs and
  409.    mouse), the TOS-version of NKCC should be used (file NKCC_TOS.O). Some
  410.    functions for multi event and mouse handling are missing in that file,
  411.    making it some KBytes smaller.
  412.  
  413.    The functions, which have to be called, are:
  414.  
  415.    nkc_conin()
  416.       works similar to the GEMDOS functions Cconin()/Crawcin() or the BIOS
  417.       function Bconin(2). It waits until a key is pressed and returns its code
  418.       in normalized format, as 16 bit integer. The function bases on GEMDOS'
  419.       Crawcin(). If you like to use Cconin() or Bconin(), just change the
  420.       system call in the NKCC source.
  421.  
  422.    nkc_cstat()
  423.       replaces Cconis() respectively Bconstat(). It checks, if there is any key
  424.       code in the OS internal key buffer and returns an according status:
  425.       0=no key, -1=at least one key in buffer
  426.  
  427.  
  428.  
  429.  
  430.    6. NKCC in GEM applications
  431.    =============================================================================
  432.    In GEM applications or accessories, NKCC replaces the whole multi event
  433.    handler with its function nkc_multi(), which gets the same parameters as
  434.    usual C multi event bindings. The differences are:
  435.  
  436.    a) key codes are returned in normalized format
  437.  
  438.    b) the key state is returned NKCC compatible, which means: key state flags
  439.       are placed in bits 8...11 rather than bits 0...3 and can be testet using
  440.       the NKF_... symbols
  441.  
  442.  
  443.    There's no NKCC function which replaces evnt_keybd(). Please use nkc_multi()
  444.    instead - or write your own binding!
  445.  
  446.  
  447.  
  448.    Special extension for assembler programmers - by Gerd Knops
  449.    ------------------------------------------------------------
  450.  
  451.    When using the event_multi-routine, you probably have code like
  452.    this in your source-code:
  453.  
  454.    ... setting up the aes-arrays, then
  455.           bsr     aes
  456.  
  457.    with
  458.  
  459.    aes:   move.l  #aespb,d1
  460.           move    #$c8,d0
  461.           trap    #2
  462.           rts
  463.  
  464.    Simply replace 'bsr  aes' with 'bsr nkc_amulti'. Note, that you
  465.    have to use the AES-arrays from NKCC for this purpose.
  466.    See chapter 9 for a symbol overview.
  467.  
  468.  
  469.  
  470.    7. The button event handler
  471.    =============================================================================
  472.    Some years ago Atari released the long awaited TOS version 1.04. It had some
  473.    very nice new features and improvements. TOS 1.04 (or a higher version) is a
  474.    must for every ST user. Unfortunately, the guys in Sunnyvale messed up the
  475.    multi event handler in the AES, making it impossible to receive mouse button
  476.    events and timer events with short cycle times in one evnt_multi() call,
  477.    without having big problems with the double click: the multi event returns
  478.    immediately when a timer event occurs. If it was just processing a mouse
  479.    click (waiting for a possible second click), the resulting event mask is
  480.    MU_TIMER *and* MU_BUTTON! No chance to get through a double click.
  481.  
  482.    I spent hours to find a way how I could bypass this problem. Finally, I
  483.    decided to write an own mouse button event handler, and put it into NKCC.
  484.  
  485.    The NKCC button event handler is activated at initialization time. Two flags
  486.    in the longword passed to nkc_init() control whether the handler should be
  487.    installed or not:
  488.  
  489.    NKI_BUTHND              install it
  490.  
  491.    NKI_BUTHND|NKI_BHTOS    install it, if TOS version has mouse click bug (TOS
  492.                            version >= 1.04 and < 3.06)
  493.  
  494.    If the NKI_BUTHND flag is not set, the handler will not be installed (the
  495.    state of the NKI_BHTOS flag is ignored in this case).
  496.  
  497.    The second parameter of nkc_init() is the handle of a virtual VDI
  498.    workstation, which had to be opened by NKCC's caller (NKCC uses a VDI
  499.    vex_butv() call). The workstation may not be closed until nkc_exit() was
  500.    called. If the mouse button event handler has not been installed, the
  501.    handle is ignored.
  502.  
  503.    Another fine feature of the button event handler is an additional flag in
  504.    the event mask: MU_XTIMER. If this flag is set (together with MU_TIMER),
  505.    timer events will only return if no redraw-critical user action is taken
  506.    (like moving windows or sliding through the menu bar). This prevents redraw
  507.    problems, e.g. when the timer event is used to update a mouse coordinate
  508.    display.
  509.  
  510.    Note: the NKCC button event handler supports the (undocumented) negation
  511.    flag, which is passed in bit 8 of the parameter <bclicks> (maximum # of
  512.    mouse clicks to wait for). You don't know this flag? I found an article
  513.    about it in the c't magazine (I think it was issue 3/90, or maybe 4/90??) -
  514.    and I damned Atari for their bad documentation. This flag opens the way to
  515.    check BOTH mouse buttons at the same time without any problems. When set,
  516.    the return condition is inverted. Let's have a look at an example:
  517.  
  518.    mask = evnt_multi(MU_BUTTON,2,3,3,...
  519.  
  520.    This doesn't work the way we want: the return condition is "button #0
  521.    pressed AND button #1 pressed". But look at this:
  522.  
  523.    mask = evnt_multi(MU_BUTTON,0x102,3,0,...
  524.  
  525.    Now the condition is "NOT (button #0 released AND button #1 released)". Or
  526.    in other words: "button #0 pressed OR button #1 pressed". Nice, isn't it?!
  527.  
  528.  
  529.    Final note: the mouse click bug is fixed since TOS version 3.06.
  530.    Thanks to Atari Corp.!
  531.  
  532.  
  533.  
  534.  
  535.    8. Other fine extra features
  536.    =============================================================================
  537.    NKCC includes some functions primary built in for its own purposes. However,
  538.    some of this functions could also be useful for the programmers using NKCC,
  539.    so they are exported and documented. Here's a list of them:
  540.  
  541.    nkc_timer()
  542.       returns the current value of the 200 Hz system clock as unsigned longword.
  543.       The function is very fast, because it just has to copy the value from an
  544.       internal static variable to the return register.
  545.  
  546.       Note: if NKCC's timer interrupt is not installed, the function will
  547.             always return 0. See chapter 4 for details.
  548.  
  549.    nkc_kstate()
  550.       returns the current state of the Shift, Control, Alternate and CapsLock
  551.       keys in NKCC compatible format. This function is very fast, too!
  552.  
  553.    nkc_tconv()
  554.       is the heart of NKCC: the raw key code converter, which transforms a TOS
  555.       key code to the normalized format. However, it does not perform deadkey
  556.       handling, ASCII input or Control key emulation.
  557.  
  558.    nkc_gconv()
  559.       is a variant of nkc_tconv(), which gets the key code in GEM format (16
  560.       bit integer instead of 32 bit, and NO KEY STATE FLAGS!). nkc_gconv() is
  561.       surely not perfect - but that's no NKCC's fault! The key state flags are
  562.       very very important for proper conversion, and without them, several
  563.       key combinations cannot be distinguished (as meantioned in the first
  564.       chapter of this documentation). Whenever possible, use nkc_tconv()!
  565.       nkc_gconv() is more an emergency exit, which should only be used when the
  566.       key state flags are lost.
  567.  
  568.    nkc_n2tos()
  569.       converts normalized key codes back to TOS format key codes.
  570.  
  571.    nkc_n2gem()
  572.       converts normalized key codes back to GEM format key codes.
  573.  
  574.    nkc_vlink()
  575.       This function links a standard XBRA routine to a vector list. The vector
  576.       can be chosen either as absolute address (e.g. $502 for the hardcopy
  577.       vector) or as number (e.g. $02 for the bus error handler vector).
  578.  
  579.    nkc_vunlink()
  580.       The counterpart of nkc_vlink(). A function is removed from an XBRA vector
  581.       list.
  582.  
  583.    nkc_toupper()
  584.       A character is converted to upper case. In contrast to most C compiler
  585.       library functions (ctypes.h) this functions treats foreign language
  586.       characters (e.g. 'ä', 'é') correctly!
  587.  
  588.    nkc_tolower()
  589.       The counterpart of the previous function: a character is converted to
  590.       lower case.
  591.  
  592.  
  593.    For a detailed documentation of the functions consult NKCC.TXT.
  594.  
  595.  
  596.  
  597.  
  598.    9. Symbol overview
  599.    =============================================================================
  600.    Here's an overview of all symbols exported by NKCC. Functions are marked
  601.    with parentheses behind the symbol name:
  602.  
  603.       nkc_init()     initialize and configure NKCC, optional installation of an
  604.                      own mouse button event handler
  605.       nkc_exit()     exit NKCC (unlink own functions from the system etc.)
  606.       nkc_set()      enable/disable the special key handler functions
  607.                      (deadkeys, direct ASCII input, Control key emulation)
  608.       nkc_conin()    raw console character input in NKCC format (based on
  609.                      GEMDOS' Crawcin())
  610.       nkc_cstat()    sample console input status (based on GEMDOS' Cconis())
  611.    *  nkc_multi()    AES multi event binding, which returns key codes and shift
  612.                      key flags in normalized format
  613.    *  nkc_amulti()   AES multi event binding for assembler programs
  614.       nkc_tconv()    raw key code converter (TOS -> normalized format)
  615.       nkc_gconv()    additional key code converter (GEM -> normalized format)
  616.       nkc_n2tos()    additional key code converter (normalized format -> TOS)
  617.       nkc_n2gem()    additional key code converter (normalized format -> GEM)
  618.       nkc_kstate()   sample state of Shift, Control, Alternate and CapsLock
  619.                      keys in normalized format; very fast!
  620.       nkc_timer()    return current timer value of 200 Hz system clock; very
  621.                      fast! Note: if timer is disabled, the function always
  622.                      returns 0 (see chapter 4)
  623.       nkc_cmp()      compare two key codes due to standard comparism rules
  624.       nkc_vlink()    link function to XBRA vector list
  625.       nkc_vunlink()  unlink function from XBRA vector list
  626.       nkc_toupper()  lower case -> upper case conversion
  627.       nkc_tolower()  upper case -> lower case conversion
  628.  
  629.    *  nkc_contrl     AES/VDI control array
  630.    *  nkc_intin      AES/VDI integer input array
  631.    *  nkc_intout     AES/VDI integer output array
  632.    *  nkc_adrin      AES address input array
  633.    *  nkc_adrout     AES address output array
  634.                      (unfortunately the correct names - addrin and addrout -
  635.                       would create a doubly defined symbol because the
  636.                       DRI object file format supports only 8 characters per
  637.                       symbol - gosh!)
  638.    *  nkc_ptsin      VDI pointers input array
  639.    *  nkc_ptsout     VDI pointers output array
  640.                      (all arrays used for nkc_amulti())
  641.  
  642.  
  643.    *  not available in NKCC_TOS.O which is for TOS applications and excludes
  644.       the GEM part of NKCC (assembled with the NKCGEM symbol set to 0; see
  645.       header of NKCC.TXT)
  646.  
  647.    =============================================================================
  648.    End Of File
  649.